From 9cc3993ccd1d022c9a3a16bee001d71ab5edc9ff Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 20 Jun 2006 01:49:43 +0000 Subject: [PATCH] Test for EOF on read in an1 reader. --- an1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/an1.c b/an1.c index 134335ee2..e47af08d7 100644 --- a/an1.c +++ b/an1.c @@ -154,7 +154,9 @@ static unsigned char ReadChar( FILE *f ) { unsigned char result = 0; - fread( &result, 1, 1, f ); + if (fread( &result, 1, 1, f ) < 1) { + fatal( MYNAME ": error reading an1 file. Perhaps this isn't really an an1 file."); + } return result; } -- 2.30.2